import {pageModalTip as pagetip, filterIp, filterPort} from '/js/usemain.js';

function exportjson() {
	let link = document.createElement('a');
	link.download = 'json';
	link.href = '../nginxset/downloadjson';
	link.click();
}

function exporttable() {
	let link = document.createElement('a');
	link.download = 'table';
	link.href = '../nginxset/downloadtable';
	link.click();
}

function exportorgconf() {
	let link = document.createElement('a');
	link.download = 'nginx';
	link.href = '../nginxset/downloadorgconf';
	link.click();
}
function exportconf(typebs) {
	let isBs = false;
	if (typebs) {
		isBs = true;
	}
	let link = document.createElement('a');
	link.download = 'nginx';
	link.href = '../nginxset/downloadconf?isBs='+isBs;
	link.click();
}
function exportbsconf() {
	exportconf(true);
}
function exportcsconf() {
	exportconf(false);
}

$('#section5').children('div:eq(0)').children('div:eq(1)').children('button:eq(0)').click(exportjson);
$('#section5').children('div:eq(0)').children('div:eq(1)').children('button:eq(1)').click(exporttable);
$('#section5').children('div:eq(0)').children('div:eq(1)').children('button:eq(2)').click(exportorgconf);
$('#section5').children('div:eq(0)').children('div:eq(1)').children('button:eq(3)').click(exportbsconf);
$('#section5').children('div:eq(0)').children('div:eq(1)').children('button:eq(4)').click(exportcsconf);